<html><head><title>DatabaseUpdate</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">DatabaseUpdate()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>DatabaseUpdate</b></font>(#Database, Request$)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Executes a modification query on the given database. This command doesn't return 
any record. To perform a 'SELECT' like query, use <a href="databasequery.html">DatabaseQuery()</a>. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Database</i></td>
<td width="90%"> 
The database to use. 

</td></tr>
<tr><td><i>Request$</i></td>
<td> 
The query to execute. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero if the query was successful or zero if it failed (due to a SQL error or a badly-formatted query). 

</blockquote><p><b>Remarks</b></p><blockquote>

This function is similar to <a href="databasequery.html">DatabaseQuery()</a> but is independent from the 
<a href="nextdatabaserow.html">NextDatabaseRow()</a> function. Therefore it's not possible to do a 'SELECT' like query 
with this function. This function is useful for updating records in the database. 
In the event of an error, the error text can be retrieved with <a href="databaseerror.html">DatabaseError()</a>. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#006666">; First, connect to a database with an employee table</font>
  <font color="#006666">;</font>
  <b><font color="#006666">If</font></b> <font color="#006666">DatabaseQuery</font>(<font color="#924B72">#Database</font>, "SELECT * FROM employee") <font color="#006666">; Get all the records in the 'employee' table</font>
  
    <b><font color="#006666">While</font></b> <font color="#006666">NextDatabaseRow</font>(<font color="#924B72">#Database</font>) <font color="#006666">; Loop for each records</font>
      
      <font color="#006666">; Update the 'checked' field for each records, assuming the 'id' field is </font>
      <font color="#006666">; the first one in the 'employee' table</font>
      <font color="#006666">;</font>
<font color="#006666">      DatabaseUpdate</font>(<font color="#924B72">#Database</font>, "UPDATE employee SET checked=1 WHERE id="+<font color="#006666">GetDatabaseString</font>(<font color="#924B72">#Database</font>, 0)) 
    <b><font color="#006666">Wend</font></b>
    
<font color="#006666">    FinishDatabaseQuery</font>(<font color="#924B72">#Database</font>)
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="databasequery.html">DatabaseQuery()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=databasequery.html>DatabaseQuery()</a> - <a href=index.html>Database Index</a> - <a href=examinedatabasedrivers.html>ExamineDatabaseDrivers()</a> ->

</body></html>